Analysis of the competition among viral strains using a temporal interaction-driven contagion model

The temporal dynamics of social interactions were shown to influence the spread of disease. Here, we model the conditions of progression and competition for several viral strains, exploring various levels of cross-immunity over temporal networks. We use our interaction-driven contagion model and characterize, using it, several viral variants. Our results, obtained on temporal random networks and on real-world interaction data, demonstrate that temporal dynamics are crucial to determining the competition results. We consider two and three competing pathogens and show the conditions under which a slower pathogen will remain active and create a second wave infecting most of the population. We then show that when the duration of the encounters is considered, the spreading dynamics change significantly. Our results indicate that when considering airborne diseases, it might be crucial to consider the duration of temporal meetings to model the spread of pathogens in a population.


Analysis of the competition among viral strains using a temporal interaction-driven contagion model Alex Abbey 1 , Yuval Shahar 2 & Osnat Mokryn 1*
The temporal dynamics of social interactions were shown to influence the spread of disease. Here, we model the conditions of progression and competition for several viral strains, exploring various levels of cross-immunity over temporal networks. We use our interaction-driven contagion model and characterize, using it, several viral variants. Our results, obtained on temporal random networks and on real-world interaction data, demonstrate that temporal dynamics are crucial to determining the competition results. We consider two and three competing pathogens and show the conditions under which a slower pathogen will remain active and create a second wave infecting most of the population. We then show that when the duration of the encounters is considered, the spreading dynamics change significantly. Our results indicate that when considering airborne diseases, it might be crucial to consider the duration of temporal meetings to model the spread of pathogens in a population.
Human communities are complex social systems in which emergent properties-such as the dynamic nature of a viral infection -result from their members' local, uncoordinated temporal interactions 1-3 . Viral transmission is mediated through the community's members' temporal interactions in the community. The sequence and order of these interactions, termed time-respecting paths, are critical for accurate modeling of the progression of a disease [4][5][6] .
Here, we use temporal networks with time-respecting paths and continuous-time network histories 7,8 as well as a real-world contact network 9 to model multiple competing variants in a population. As SARS-CoV-2 continues to mutate, some of its variants become variants of concern. These variants either differ in their transmissibility, infectivity, pathogenicity or their ability to evade immunity [10][11][12][13] .
We quantify the competition conditions between variants that differ in their transmissibility and under changing levels of cross-immunity, over temporal random networks, with our interaction-driven contagion model 8 . Previous studies considered two competing pathogens in a population with full cross-immunity. Being infected by one of the pathogens provides subsequent immunity to both. Studies have demonstrated that the faster pathogen is more likely to dominate the network 14-17 . When different cross-immunity levels are considered, this is not necessarily the case 18 . However, these studies did not consider the temporal ordering of events and the time-respecting paths.
There are numerous practical considerations when considering competition conditions between variants in a population. Co-existing variants compete on a shared resource that is the transmission vehicle, i.e., the population 19 . There is an interplay between the network's dynamics and the dynamics of the disease that determines the course of the disease 20,21 . For example, a variant that leads to more severe disease in the population causes more people to become more severely ill and for a longer duration 22 , thus changing the network's dynamics as people are removed from the network for longer periods than is the case with other variants. Variants may also differ in their initial conditions. They may arrive at different stages of immunity or differ in their transmission opportunities 6,12,23,24 .
We consider competing variants under changing conditions of cross-immunity over two types of temporal networks: temporal random networks and real-life contacts, using our interaction-driven SEIR-like model for temporal networks 8 . The advantages of working with real-life temporal interactions are numerous, as human interactions are bursty, temporal, highly contextual and networked 2,4,[25][26][27][28] . We model the competition between multiple variants on temporal networks while considering various cross-immunity dynamics. www.nature.com/scientificreports/ Our surprising results are that slower variants continue to infect in the presence of faster (and even much faster) variants. When there is no cross-immunity, the slower variant creates a second wave and reinfects the population previously infected by the faster variant. We further determine, using a heatmap of total infection ratio between the variants under changing conditions of cross-immunity, the conditions under which a slow variant would be the dominant variant in a second phase and will infect the majority of the population.
We then proceed to model the competition between three variants in random temporal networks and realworld contact networks, with either full cross-immunity or no cross-immunity at all, with our SEIR-like interaction-driven model. We show that both networks provide similar results for the competition under full crossimmunity when considering maximal infection probabilities. When there is no cross-immunity, the dynamics of all three variants are similar over the real-world network, with the faster variants, i.e., with a higher probability of infection, infecting a larger part of the population than the slower ones.
The competition dynamics differ substantially when the duration of the meetings is taken as a factor in the contagious process. When variants differ by the minimal time it takes them to infect, with faster variants taking less time to infect than slower variants, the competing conditions become more complex. The slowest variant dies out, leaving the two faster ones to compete. The fast variant dominates a larger part of the network and for a longer duration, followed by the second fastest variant, which creates a large second wave in which it infects at a faster rate than the rate at which that variant infected during the first wave.
Thus, we show here that when the duration of meetings is considered in the modeling of temporal networks, the spreading process of competing variants is substantially different.

Results
Race conditions between two variants with changing values of cross-immunity. We created a temporal random network with 10,000 time windows of 1000 nodes each using the RandomDynamicGraph (RDG) package 8 . A time window duration is denoted by τ , and consists of 288 × 5-min intervals. Two variants were determined, a slow variant, and a fast variant, s.t.
where P fast max , P slow max are the probabilities of being infected in maximum exposure to the fast (or slow) variant, as defined in Eq. (1). The values were chosen to allow for competition conditions. Both variants begin simultaneously with a randomly chosen patient zero in the first time window. Each experiment was repeated 200 times. We use our SEIR-like model. Figure 1 describes the results of our first experiment. Here, we examine the competition under various immunity conditions. In Fig. 1a we can see that when there is full cross-immunity, the faster variant infects the majority of the population, while the slower one obtains much less. Both variants plateau at the same time. This changes when a breakthrough infection is possible with the faster variant, as can be seen in Fig. 1b. Here, the slower variant infects a small portion of the population, who, once recovered, infected again with the faster variant. When the breakthrough probability is from the faster variant to the slower one, i.e., cross-immunity only from the slow variant to the fast one, we can see in Fig. 1c that the fast variant saturates when it infects around 60% of the population. Then the slower variant takes over and infects the vast majority of the population, infecting close to 90% of the population. In Fig. 1d we see that when both variants can reinfect, most of the population would first be infected by the fast variant but then, after recovery, would also be infected with the slower one.
We continue to evaluate the infection probability of each of the variants, slower and faster, under changing conditions of cross-immunity. Figure 2 depicts the total infection ratio between the fast and the slower variants. Let us term the fast variant as f and the slow variant s. The cross-immunity probability was changed in steps of 0.05 from zero to one for each of the variants ( {χ f →s , χ s→f } ∈ [0, 0.05, . . . 1] ). Each of these combinations was iterated 30 times, to a total of 12,000 iterations for the heatmap. The results were normalized to the range [−1, 1] . The heatmap shows that in the majority of the cases, the fast variant is the dominant variant, and the ratio is more on the blue scale. When there is no cross-immunity between the variants, i.e., a person can be reinfected with a variant after recovering from the other, both variants manage to reinfect the entire population. This corresponds to the upper left corner of the heatmap. In Fig. 1d we see the aggregated infection in the population per variant with χ f →s = χ s→f = 0 . Both variants infect the population at a different rate. When the faster variant saturates, the slower variant reinfects those that recovered from the fast variant in a second wave. Thus, the fast variant infects the population in a first wave, and the slower variant, infecting some of the population initially, infects the rest in a second wave. From Fig. 2 we see that this scenario describes the area in which χ f →s ≤ 0.4 and χ s→f ≤ 0.3.
However, interestingly, the slow variant dominates the population, and the ratio calculated in the heatmap (the red zone in the upper right corner of the heatmap in Fig. 2) greatly favors the slow strain, when infection with the slower variant results in immunity to the faster one but not vice-versa. In our experiments, the conditions are that χ s→f ≥ 0.5 and χ f →s ≤ 0.4.
Conditions that allow competition. It is then left to see under which conditions a slower variant can create a second wave of infection. Figure 3 shows the aggregated percentage of infections in a population for two competing variants. The left panel depicts two similar variants. Both variants advance at the same rate and can reinfect the population recovered from the competing variant. The right panel shows two variants, with the faster one ten times more contagious than the slower one. The fast variant infects all of the population rapidly. Interestingly, the much slower variant does not die out and keeps infecting at a low rate, creating a second wave in which it slowly reinfects the www.nature.com/scientificreports/ population that has recovered from the fast variant. We find that when reinfection with the competing variant is possible, slower variants can create a second wave of infection. Figure 4 depicts the competition between variants with no cross-immunity for variants that are either similar (on the left panel) or differ in their probability of infection. In the middle panel, the variant is 1.1 times more likely to infect, and in the right panel, 1.2 times. We then chose the competing conditions such that the faster variant is 1.2 times more probable to infect than the slower one. This allows for a faster and a slower variant.
Three competing variants. We continue to model the spreading of three competing variants in temporal random networks. Our modeling and considerations in Eq. (2) allow for multiple variants. We then examine the competing spreading patterns under our SEIR-like model with either full cross-immunity or no cross-immunity between the variants. In the first case, infecting in any of the variants gives immunity to the other two, and in the latter, getting infected with one of the variants enables reinfection with the others. Figure 5 shows the results of our experiment. In Fig. 5a and c we see the number of daily infections and the aggregated infections in the populations when there is full cross-immunity. The faster variant competes with both slower variants and infects less than 60% of the population. The dynamics in the case of no-cross immunity, depicted in Fig. 5b and d, are very different. In the first wave, the variants infect at rates corresponding to their infection probability. However, once the first wave is done, the fast variant drops to the infection rate of the medium speed variant, which then ramps up and reinfects faster than before. Interestingly, the slowest variant also increases its infection rate during this second wave and maintains similar dynamics to the medium variant. When there is no cross-immunity between variants, competing dynamics are more complex.
Real-world networks with three competing variants. We continue to evaluate the competition conditions of three different variants over the real-world temporal Copenhagen Networks Study (CNS) network 9,29 , described in the "Methods" Section. We model the competing variants as follows.  www.nature.com/scientificreports/ Here, As determined in the "Methods" Section there is a normalizing value D max such that D min /D max is the relative portion of P max to be used. However, in this experiment,   www.nature.com/scientificreports/ and Also in this experiment there is a normalizing value D max such that D min /D max is the relative portion of P max to be used. Each of the experiments A, B, C, was iterated 30 times with the real-world network using the encounter-driven modeling according to the conditions of the experiment described, with an initial patient zero randomly selected. Figure 6 depicts the results of the above experiments. When the duration of the interactions is ignored, as in Fig. 6a and b, the dynamics resemble, to some extent, those that were observed over temporal random networks. However, the dynamics differ significantly when meetings' duration is taken into account, considering that variants differ by the minimal amount of time needed for infection, as in Fig. 6c-f. In all these cases, the slowest variant has much fewer opportunities to infect or reinfect, causing it to disappear and leaving the two faster variants to compete. When there is full cross-immunity, the medium variant, with fewer infection opportunities than the faster one, infects at a much lower rate. However, when there is no cross-immunity, the medium-rate pathogen can create a second wave and reinfect at a higher rate than it did on the first wave. www.nature.com/scientificreports/ Our results here indicate that when considering airborne diseases, it might be crucial to consider the duration of temporal meetings to consider the spreading of variants in a population.

Discussion
Here, we presented the modeling of variants that compete over the same population with similar initial conditions over temporal networks. Previous works also considered two competing pathogens in a population. Karrer and Newman 14 considered competition in similar conditions, but on an aggregated network with full cross-immunity, that is, getting one of the diseases gives a subsequent immunity to both. They found that the fast pathogen is more likely to dominate the network in the majority of the regions of the phase diagram. Recently, Okake and Shudo 17 considered these conditions but with a lately arriving fast variant and found that the results depended on how much more infective is the added variant. They found no difference in the competition results when considering random or scale-free (BA) networks. Mann et al. 16 showed that in this setting, clustering increases the spread of the second wave. Poletto et al. 18 considered, like us, the competition under different levels of cross-immunity, however, in a mix-homogeneous aggregated network. They found that variations in the crossimmunity level induce a transition between the presence and absence of competition. Okabe and Shudo 17 found that under cross-immunity conditions, faster variants dominate. We complement this finding by showing the cross-immunity conditions under which the slower variant has a second wave. We find that when temporal paths are considered, competition conditions exist for two and three competing pathogens, and when there is no cross-immunity, there is a second wave.
This result can be considered somewhat similar to the results in 30 , who considered competition between Colonizers, i.e., fast-spreading virulent strains and less-virulent variants that are more successful within co-infected cells. They observed a two-step dynamics of the population. Early in the infection, the population is dominated by colonizers, which later are outcompeted by competitors. We show that under certain not unlikely conditions, a slow variant might be able to wait until the fast variant has run its course and then infect the majority of the population, given there is no cross-immunity or the cross-immunity is in favor of the slower strain.
However, the competing dynamics become significantly more complex when the duration of the interactions is considered. SARS-CoV-2 variants differ in their time-to-infect 6,12,23,24 . When we considered the duration of the interactions, the dynamics changed substantially. It is then clear that when considering airborne spreading processes, it is critical to consider the temporal ordering and the duration of the encounters. Interactions shorter than the minimal time of infection are less likely to mediate the disease, changing the progression paths.
In summary, we model and explore competing variants using an interaction-driven model over random and real-world temporal networks. We determine the conditions of partial cross-immunity that create a second wave in which a slower variant dominates the population. Using real-world contact data, we then show that the duration of the encounters is a fundamental modeling construct that has a significant effect on the progress of the disease and the competing dynamics of the variants.

A temporal interaction-driven contagion model for a single variant over temporal random networks.
We explain here our model, as detailed in 8 . We start by modeling the spread of a single variant on a temporal network. Let G(n,p,τ ) denote a temporal random network, where τ corresponds to any single time window in it. During each time window τ we calculate for each node i its probability P i (S → E) to be exposed and infected during this time window as the complement of probability of not being exposed to the disease in any of its encounters with infectious nodes in that time window.
where N τ i is the subset of infected nodes in time window τ that interacted with node i during that time window and thus might potentially expose it to the infection, and P max is the probability of being infected during a maximal exposure (For example, even on relatively isolated, dense sites such as the Princess Diamond ship during the first wave of the COVID-19 pandemia, and with an air conditioning system that might well have distributed the virus to multiple cabins, not more than 20% of the passengers and personnel were infected. In other such cases, the maximal infection probability seemed to lie anywhere between 20 and 60%).
The SEIR-like interaction-driven model, depicted in Fig. 7 is as follows. All nodes are initially in the Susceptible (S) state. To start the iterative computation, we also assume that a small random number of nodes in the initial time window become infectious (i.e., a small number of "Patients Zero"). Susceptible nodes (state S) that www.nature.com/scientificreports/ become exposed according to Eq. (1) enter the state Exposed (E) at the end of the time window τ during which they were exposed to infectious nodes. Nodes in state Exposed become Infected after a delay that corresponds to d E→I , where d E→I ∼ τ · N(5, 1) . Infected nodes (state I) stay infectious for d I→R , where d I→R ∼ τ · N(10, 1) . After this delay, they enter the state Recovered (R) and are no longer infectious. The chosen numbers represent days and are inspired by some of the COVID-19 variants 31 . Temporal random networks follow the algorithm suggested by Zhang et al. 7 . Their algorithm builds a temporal random network with changing dynamics that follow a Markov process, allowing for continuous-time network histories, G n,p,τ such that E(G n,p,τ ) ∼ G n,p . Defining = probability per time granule of a new edge to appear and µ = probability per time granule of an existing edge to disappear, Zhang et al. 7 show that the equilibrium probability of an edge is p = +µ .
Our implementation, a Python package that we refer to as RandomDynamicGraph (RDG), (https:// github. com/ ScanL ab-ossi/ Dynam icRan domGr aphs) described in 8 , generates large-scale dynamic random graphs according to a defined density. We chose , µ in a manner that allows for a stationary density for all G n,p,τ , where τ ∈ [1..10000] and n = 1000 . To ensure that no anomalies in one graph created an unusual effect, we used a mix of randomly generated graphs. We then conducted a Two-sample Kolmogorov-Smirnov test on each pair of graphs and determined that for each couple, we cannot reject the null hypothesis that both were drawn from the same probability distribution, with 95% significance 32 .
Modeling multiple concurrent infections. We model the various variants by a per-variant probability, denoting the maximal global probability of being infected by the variant, P j max , where j denotes the variant. Hence, a more contagious variant would correspond to a higher P max . Thus, given variants j, k, then, without loss of generality, if variant j is more contagious than variant k, then P j max > P k max . We model here the probability to be infected during a day when m variants exist in the network, as follows. Let P k i (S → E) be the probability of node i to be exposed during some given time window to variant k, k ∈ [1..m] . P k i (S → E) is calculated as is defined in Eq. (1). Then, we calculate the probability of node i to not be exposed to any of the m variants during that time window, P i (S → S) using the inclusion-exclusion principle. Given that for any k, P k i (S → E) is independent, i.e., each viral strain is operating independently of other strains, the probability of not getting infected with any variant is as follows. Let E i j be the event of node i being exposed by the end of the day to variant j, the probability that node i was not exposed to any variant at the end of the day, is computed as follows: For example, for two variants j, k, we calculate the probability of node i not being exposed to any of them during that day as follows, thus determining the probability of being infected in any of them.
Given that we determined that node i was exposed, we make a statistical choice of the variant according to the relative probabilities.
Variants cross-immunity probability. Each variant has a cross-immunity probability χ j→k , denoting the probability of a person that is recovering from variant j to be immune to variant k. Hence, 1 − χ j→k is the breakthrough probability of people recovering from variant j to get infected by variant k. χ j→k ∈ [0, 1].

Modeling variants competition over real-life encounters.
Real-world encounters data was collected in the Copenhagen Networks Study (CNS) 9,29 . It contains the proximity information of over 700 students for 28 days. We model the CNS social network of interactions Ŵ as a sequence of T consecutive undirected weighted temporal graphs {G τ ∈ Ŵ, τ ∈ T} where each temporal snapshot graph G τ = (V τ , E τ ) denotes the subset of interacting nodes V τ during the τ temporal window and the weighted edges E τ the interactions during this time. Further, we use the network with half-density, i.e., each real day is split into two days. This is done since the original proximity network is very dense 8,33 .
The CNS data contains meetings' duration information, allowing for an additional method of modeling the variants. In this method, a variant takes a minimal amount of time to infect, termed D min , such that D fast min < D slow min . There is a normalizing value D max such that D min /D max is the relative portion of P max to be used. The contagious part of the interaction-driven model is then defined by the complement of the probability of not being infected by any of the encounters that are longer than D min of that variant in a day 8 .

Code availability
All code and data used in this research are freely available: https:// github. com/ ScanL ab-ossi/ covid-simul ation. (2)  P i (S → S) = 1 − (P j exposed + P k exposed − P j exposed · P k exposed ) www.nature.com/scientificreports/ Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.